<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>重温计数器</title>
	<style>
		*{padding:0;margin:0;}
		body{background-color:#eee;}
		button{padding:0 8px;}
	</style>
</head>
<body>
	<div class="wrap" id="app">
		<h1>{{message}}</h1>
		<p><label for="num">数字：</label><input id="num" type="text" v-model="num"></p>
		<button @click="sub" type="button">减</button>
		<button @click="add" type="button">加</button>
	</div>
	<script src="js/vue.js"></script>
	<script>
		var vm = new Vue({
			el:"#app",
			data: {
				message: "计数器",
				num: 0
			},
			methods: {
				add: function(){
					this.num++;
				},
				sub: function(){
					this.num--;
				}
			}
		});
	</script>
</body>
</html>